package maosui.model;

import javax.persistence.*;

/**
 * Created by wdj on 14-8-10.
 */
@Entity
@Table(name = "51lpz_online_live_comet")
public class LiveCometEntity {
    private long id;
    private int cid;
    private String action;
    private int timestamp;
    private String datas;

    @Id
    @Column(name = "id", nullable = false, insertable = true, updatable = true)
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "cid", nullable = false, insertable = true, updatable = true)
    public int getCid() {
        return cid;
    }

    public void setCid(int cid) {
        this.cid = cid;
    }

    @Basic
    @Column(name = "action", nullable = false, insertable = true, updatable = true, length = 50)
    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    @Basic
    @Column(name = "timestamp", nullable = false, insertable = true, updatable = true)
    public int getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(int timestamp) {
        this.timestamp = timestamp;
    }

    @Basic
    @Column(name = "datas", nullable = false, insertable = true, updatable = true, length = 1024)
    public String getDatas() {
        return datas;
    }

    public void setDatas(String datas) {
        this.datas = datas;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        LiveCometEntity that = (LiveCometEntity) o;

        if (cid != that.cid) return false;
        if (id != that.id) return false;
        if (timestamp != that.timestamp) return false;
        if (action != null ? !action.equals(that.action) : that.action != null) return false;
        if (datas != null ? !datas.equals(that.datas) : that.datas != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (id ^ (id >>> 32));
        result = 31 * result + cid;
        result = 31 * result + (action != null ? action.hashCode() : 0);
        result = 31 * result + timestamp;
        result = 31 * result + (datas != null ? datas.hashCode() : 0);
        return result;
    }
}
